import request from '@/utils/request'

// 获取教师列表
export function getTeacherList (department_id = null) {
  const params = {}
  if (department_id) {
    params.department_id = department_id
  }
  return request({
    url: '/api/teacher/',
    method: 'get',
    params
  })
}

// 创建新教师
export function addTeacher (data) {
  return request({
    url: '/api/teacher/',
    method: 'post',
    data
  })
}

// 更新教师信息
export function updateTeacher (teacher_id, data) {
  return request({
    url: `/api/teacher/${teacher_id}/`,
    method: 'put',
    data
  })
}

// 删除教师
export function deleteTeacher (teacher_id) {
  return request({
    url: `/api/teacher/${teacher_id}/`,
    method: 'delete'
  })
}
